<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>动态检查屏幕视口尺寸大小</title>
  <style>
    @property --vw {
      syntax: '<length>';
      inherits: true;
      initial-value: 100vw;
    }

    @property --vh {
      syntax: '<length>';
      inherits: true;
      initial-value: 100vh;
    }

    :root {
      --w: tan(atan2(var(--vw), 1px));
      --h: tan(atan2(var(--vh), 1px));
    }

    body::after {
      content: counter(w) "X" counter(h);
      counter-reset: w var(--w) h var(--h);
      font-size: 150px;
      font-weight: 900;
      position: fixed;
      inset: 0;
      width: fit-content;
      height: fit-content;
      margin: auto;
    }
  </style>
</head>

<body>

</body>

</html>